<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
	#div1 {width: 100px; height: 100px;background: red; position: absolute; left: 0;top: 50px;}	
</style>
<script>
function startMove()
{
		var oDiv = document.getElementById('div1');
		setInterval(function(){
			var speed = (300 - oDiv.offsetLeft)/10;
			oDiv.style.left=oDiv.offsetLeft + speed + 'px';
		},30);
}
</script>
</head>

<body>
<input type="button" value="move" onClick="startMove()">
<div id="div1"></div>
</body>
</html>
